Skip to content

test(cli): tolerate transient incomplete TUI frames - #2564

Merged
M4n5ter merged 1 commit into
mainfrom
fix/tui-transient-frame-polling
Aug 9, 2026
Merged

M4n5ter merged 1 commit into
mainfrom
fix/tui-transient-frame-polling

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Aug 9, 2026

Copy link
Copy Markdown
Member
English

Summary

Fixes #2563

CLI TUI polling could fail on a valid intermediate render because editorInputText() called a helper that asserted both editor borders were already present. The assertion escaped the polling predicate immediately instead of allowing it to observe the next settled frame.

This change separates the two contracts:

  • findInputSurfaceRows() returns undefined while the input surface is incomplete, so polling remains pending.
  • inputSurfaceRows() retains strict assertions for checks that require a settled layout.

The slash-autocomplete query now reuses the same non-throwing lookup, and a focused regression preserves the intermediate-versus-settled frame contract.

Verification

  • CLI test suite: 350 passed, 0 failed
  • Affected /recap test: 20 consecutive passes
  • CLI TypeScript typecheck
  • Biome
  • git diff --check

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No
中文

概要

修复 #2563

CLI TUI 的轮询可能在合法的中间渲染 frame 上失败,因为 editorInputText() 调用了一个要求输入框上下边框已经完整存在的断言 helper。该断言会立即逃出轮询 predicate,使其无法继续观察下一个稳定 frame。

本次变更将两种契约分开:

  • findInputSurfaceRows() 在输入区域尚不完整时返回 undefined,让轮询继续等待。
  • inputSurfaceRows() 为要求稳定布局的检查保留严格断言。

Slash autocomplete 查询也复用了同一个非抛错 lookup,并添加一项聚焦回归,固定中间 frame 与稳定 frame 的契约。

验证

  • CLI 测试套件:350 通过,0 失败
  • 受影响的 /recap 测试:连续 20 次通过
  • CLI TypeScript typecheck
  • Biome
  • git diff --check

检查清单

  • 测试覆盖该变更,且修复前会失败
  • lint、format、typecheck 与受影响测试套件均已在本地通过

此 PR 是否改变行为?

  • 是——已在概要中说明

@M4n5ter
M4n5ter marked this pull request as ready for review August 9, 2026 05:24
@M4n5ter
M4n5ter merged commit 101d2f5 into main Aug 9, 2026
11 checks passed
@M4n5ter
M4n5ter deleted the fix/tui-transient-frame-polling branch August 9, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(cli): tolerate transient incomplete TUI frames in polling assertions

1 participant